#pragma once
#include "SkinSysHeader.h"

template <class T, class TBase  = CWindow , class TWinTraits = CControlWinTraits >
class CSkinWindowImpl : public CWindowImpl<T, TBase, TWinTraits >
{
public:

    HWND Create(
        _In_opt_ HWND hWndParent,
        _In_ _U_RECT rect = NULL,
        _In_opt_z_ LPCTSTR szWindowName = NULL,
        _In_ DWORD dwStyle = 0,
        _In_ DWORD dwExStyle = 0,
        _In_ _U_MENUorID MenuOrID = 0U,
        _In_opt_ LPVOID lpCreateParam = NULL, LPCTSTR lpszClassName = NULL )
    {
        if ( T::GetWndClassInfo().m_lpszOrigName == NULL )
            T::GetWndClassInfo().m_lpszOrigName = GetWndClassName();

        if ( NULL != lpszClassName )
        {
            T::GetWndClassInfo().m_atom = 0;
            T::GetWndClassInfo().m_wc.lpszClassName = lpszClassName;
        }

        ATOM atom = T::GetWndClassInfo().Register( &m_pfnSuperWindowProc );

        dwStyle = T::GetWndStyle( dwStyle );
        dwExStyle = T::GetWndExStyle( dwExStyle );

        // set caption
        if ( szWindowName == NULL )
            szWindowName = T::GetWndCaption();

        return CWindowImplBaseT< TBase, TWinTraits >::Create( hWndParent, rect, szWindowName,
                dwStyle, dwExStyle, MenuOrID, atom, lpCreateParam );
    }

//     LRESULT OnDestroy(UINT uMsg,WPARAM wParam ,LPARAM lParam,BOOL& bHandle)
//     {
//         return 0;
//     }
//
//     LRESULT OnPaint(UINT uMsg,WPARAM wParam ,LPARAM lParam,BOOL& bHandle)
//     {
//         return 0;
//     }
//
//     LRESULT OnCreate(UINT uMsg,WPARAM wParam ,LPARAM lParam,BOOL& bHandle)
//     {
//         return 0;
//     }
//
//     LRESULT OnCommand(UINT uMsg,WPARAM wParam ,LPARAM lParam,BOOL& bHandle)
//     {
//         return 0;
//     }
};